<!DOCTYPE html>
<html>
<head>
    <title></title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.goodsName" @on-enter="query" placeholder="商品名称"/>
                </i-col>
                <i-button @click="query">查询</i-button>
            </div>
            <div class="buttons-group">
                #if($shiro.hasPermission("product:save"))
                <i-button type="info" @click="initAll"><i class="fa fa-plus"></i>&nbsp;生成所有规格产品</i-button>
                #end
                #if($shiro.hasPermission("product:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("product:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("product:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="product" :rules="ruleValidate" :label-width="80">
		    <Affix :offset-top="50">
		        <span class="demo-affix">商品id:{{goods.id}}__{{goods.name}}</span>
		    </Affix>
            <Form-item label="商品序列号" prop="goodsSn">
                <i-input v-model="product.goodsSn" placeholder="商品序列号"/>
            </Form-item>
            <Form-item label="商品库存" prop="goodsNumber">
                <Input-number :min="0" :step="1" v-model="product.goodsNumber" placeholder="商品库存"
                              style="width: 188px;"/>
            </Form-item>
            
            <Form-item label="规格" prop="goodsNumber" v-for="(item, index) in goodsSpecificationsList" >
	            <Radio-group v-model="goodsSpecificationIds[index]" @on-change="conlog">
			        <Radio :label="specification.id" v-for="specification in item">
			            <span>{{specification.value}}</span>
			        </Radio>
			    </Radio-group>
            </Form-item>
            
            <Form-item label="展示价格" prop="counterPrice">
            	<Input-number :min="0" :step="1" v-model="product.counterPrice" placeholder="展示价格"
            style="width: 188px;"/>
            </Form-item>
            <Form-item label="零售原价" prop="unitPrice">
            	<Input-number :min="0" :step="1" v-model="product.unitPrice" placeholder="零售原价"
            style="width: 188px;"/>
            </Form-item>
            <Form-item label="会员价（7.5折）" prop="retailPrice">
                <Input-number :min="0" :step="1" v-model="product.retailPrice" placeholder="会员价"
                              style="width: 188px;"/>
            </Form-item>
            <Form-item label="代理价（5.8折）" prop="marketPrice">
                <Input-number :min="0" :step="1" v-model="product.marketPrice" placeholder="代理价"
                              style="width: 188px;"/>
            </Form-item>
            <Form-item label="特惠价(4.5折)" prop="marketPrice">
                <Input-number :min="0" :step="1" v-model="product.appExclusivePrice" placeholder="特惠价"
                              style="width: 188px;"/>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>
                返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>

<script src="${rc.contextPath}/js/shop/product.js?_${date.systemTime}"></script>
</body>
</html>